<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="vue.js"></script>
    <title>Document</title>
    <style>
        nav{
            width: 600px;
            height: 50px;
            background-color:cyan;
        }
        ul{
            list-style-type: none;
            display: flex;
            justify-content: space-around;
            line-height: 50px;
        }
        li:hover{
            background-color: pink;
        }
    </style>
</head>

<body>
    <main id="app">
        <nav>
            <ul>
                <li @click='click("HOME")'>HOME</li>
                <li @click='click("NEWS")'>NEWS</li>
                <li @click='click("PROJECT")'>PROJECT</li>
                <li @click='click("SERVICES")'>SERVICES</li>
                <li @click='click("CONTACT")'>CONTACT</li>
            </ul>
        </nav>
        <div>当前页面为：{{name}}</div>
    </main>
    <script>
        var vue = new Vue({
            el: '#app',
            data: {
                name: 'home'
            },
            methods:{
                click:function(val){
                    this.name=val
                }
            }
        })
    </script>
</body>

</html>